package cn.kgc.psringboot.exception;

import org.apache.shiro.authz.AuthorizationException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * @author: mosin
 * @version: v1.0  2022/11/17
 */
@ControllerAdvice
public class GlobalException {

    @ExceptionHandler(Exception.class)
    public String  exception(Exception e){
        e.printStackTrace();
        return "redirect:/500.jsp";
    }

    @ExceptionHandler(AuthorizationException.class)
    public String  authorizationException(AuthorizationException e){
        return "redirect:/403.jsp";
    }

}
